import request from '@/utils/request'

// 创建生产退货单
export function createProduceOut(data) {
  return request({
    url: '/wms/produce-out/create',
    method: 'post',
    data: data
  })
}

// 更新生产退货单
export function updateProduceOut(data) {
  return request({
    url: '/wms/produce-out/update',
    method: 'put',
    data: data
  })
}

// 删除生产退货单
export function deleteProduceOut(id) {
  return request({
    url: '/wms/produce-out/delete?id=' + id,
    method: 'delete'
  })
}

// 获得生产退货单
export function getProduceOut(id) {
  return request({
    url: '/wms/produce-out/get?id=' + id,
    method: 'get'
  })
}

// 审核
export function approveProduceOut(id) {
  return request({
    url: '/wms/produce-out/approve?id=' + id,
    method: 'put'
  })
}

// 撤审
export function cancelProduceOut(id) {
  return request({
    url: '/wms/produce-out/cancel?id=' + id,
    method: 'put'
  })
}

// 获得生产退货单分页
export function getProduceOutPage(query) {
  return request({
    url: '/wms/produce-out/page',
    method: 'get',
    params: query
  })
}

// 导出生产退货单 Excel
export function exportProduceOutExcel(query) {
  return request({
    url: '/wms/produce-out/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
